package cn.shlbysj.demo.service.impl;

import cn.shlbysj.demo.entity.ArtInfo;
import cn.shlbysj.demo.entity.ArtInfoExample;
import cn.shlbysj.demo.entity.OnlineExp;
import cn.shlbysj.demo.entity.OnlineExpExample;
import cn.shlbysj.demo.mapper.ArtInfoMapper;
import cn.shlbysj.demo.mapper.OnlineExpMapper;
import cn.shlbysj.demo.service.IOnlineExpService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("onlineExpService")
@Transactional
public class IOnlineExpServiceImpl implements IOnlineExpService {

    @Autowired
    private OnlineExpMapper onlineExpDao;

    @Override
    public List<OnlineExp> getList() {
        PageHelper.startPage(1,9);
        OnlineExpExample example=new OnlineExpExample();
        example.setOrderByClause("`create_time` desc");
        OnlineExpExample.Criteria criteria = example.createCriteria();
        Page<OnlineExp> list =(Page<OnlineExp>)onlineExpDao.selectByExample(example);
        return list.getResult();
    }
}
